<template>
	<up-tabbar :value="curTab" @change="changeTab" :placeholder="false">
		<up-tabbar-item name="/pages/index/index" text="首页" icon="home"></up-tabbar-item>
		<up-tabbar-item name="/pages/linechat/linechat" text="消息" icon="photo"></up-tabbar-item>
		<up-tabbar-item name="/pages/my/my" text="我的" icon="account"></up-tabbar-item>
	</up-tabbar>
</template>

<script setup>
import { ref } from 'vue';

	const curTab = ref('')
	// 获取当前页面的地址，根据地址做高亮的处理
	const pages = getCurrentPages()
	const curPage = pages[pages.length - 1]
	curTab.value = '/' + curPage.route
	console.log(curPage)
	const changeTab = (name) => {
		console.log(name)
		uni.navigateTo({
			url: name
		})
	}
</script>

<style>

</style>